<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">

<head>
	<title>Matchingo: Get your match on.</title>
	<link rel="stylesheet" type="text/css" href="fbmain.css" />	
	<link rel="icon" href="http://www.matchingo.com/Matchingo.ico" type="image/x-icon"/>
    <link rel="shortcut icon" href="http://www.matchingo.com/Matchingo.ico" type="image/x-icon"/> 

	<script type="text/javascript" src="Silverlight.js"></script>
	<script type="text/javascript">

	        function onSourceDownloadProgressChanged(sender, eventArgs) {
	            var myHost = document.getElementById("MainXaml");
	            var rectBar = myHost.content.findName("RectBar");
	            var rectBorder = myHost.content.findName("RectBorder");
	            if (eventArgs.progress)
	                rectBar.Width = eventArgs.progress * rectBorder.Width;
	            else
	                rectBar.Width = eventArgs.get_progress() * rectBorder.Width;
	        }

	        function onSilverlightError(sender, args) {

	            var appSource = "";
	            if (sender != null && sender != 0) {
	                appSource = sender.getHost().Source;
	            }
	            var errorType = args.ErrorType;
	            var iErrorCode = args.ErrorCode;

	            var errMsg = "Unhandled Error in Silverlight 2 Application " +  appSource + "\n" ;

	            errMsg += "Code: "+ iErrorCode + "    \n";
	            errMsg += "Category: " + errorType + "       \n";
	            errMsg += "Message: " + args.ErrorMessage + "     \n";

	            if (errorType == "ParserError")
	            {
	                errMsg += "File: " + args.xamlFile + "     \n";
	                errMsg += "Line: " + args.lineNumber + "     \n";
	                errMsg += "Position: " + args.charPosition + "     \n";
	            }
	            else if (errorType == "RuntimeError")
	            {
	                if (args.lineNumber != 0)
	                {
	                    errMsg += "Line: " + args.lineNumber + "     \n";
	                    errMsg += "Position: " +  args.charPosition + "     \n";
	                }
	                errMsg += "MethodName: " + args.methodName + "     \n";
	            }

	            // TODO:: this alert is getting thrown with some sort of image error
	            // alert(errMsg);
	            throw new Error(errMsg);
	        }
    </script>
	<script type="text/javascript">
	    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>

	<script type="text/javascript">
	    try {
	    	var pageTracker = _gat._getTracker("UA-9452556-2");
	        pageTracker._trackPageview();
	       } catch (err) { }

	       var url = document.URL;
	       if (url.indexOf('fb_sig_session_key') < 1 && url.indexOf('auth_token') < 1) {
	       	window.location = 'http://api.facebook.com/login.php?api_key=a034f68d16e8318e7c0b149202d0499a&v=1.0&popup=1';
	       }
	</script>

</head>

<body>
    <div class="header">
        <p style="line-height:21px">
			<a href="http://www.michaelurvan.com" target="_blank"><b>Michael Urvan</b></a> designed the Facebook integration and enhancements<br />
			Original development by SmartyP of <a href="http://www.smartypantscoding.com" target="_blank">SmartyPantsCoding.com</a>
        </p>
	</div>    
	<div class="game">
		<object id="MainXaml" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="360" height="430">
					<param name="source" value="ClientBin/Matchingo.Facebook.xap"/>
					<param name="splashscreensource" value="SplashScreen.xaml"/>
					<param name="onSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" />
					<param name="onerror" value="onSilverlightError" />
					<param name="background" value="white" />
					<param name="minRuntimeVersion" value="2.0.31005.0" />
					<param name="autoUpgrade" value="true" />
					<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
						<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
					</a>
		</object>
	</div>
</body>
</html>
